<extend name="Public/publicHTML" />

<block name='content'>
<link href="__COMMON__/daterangepicker/daterangepicker-bs3.css"
	rel="stylesheet" type="text/css" />
<script src="__COMMON__/daterangepicker/moment.min.js"
	type="text/javascript"></script> <script
	src="__COMMON__/daterangepicker/daterangepicker.js"
	type="text/javascript"></script>
<link rel="stylesheet" href="__COMMON__/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="__COMMON__/bootstrap/css/font-awesome.min.css" />


<section class="content ">
	<!-- Main content -->
	<div class="container-fluid">
		<div class="panel panel-default">
			<div class="panel-body ">
				<!--表单数据-->
				<form action="" method="post" id='form'>
					<!--通用信息-->
					<div class="tab-content col-md-10">
						<div class="tab-pane active" id="tab_tongyong">
							<table class="table table-bordered">
								<tbody>
									<tr>
										<td class="col-sm-2">优惠券名称：</td>
										<td class="col-sm-4"><input type="text"
											value="{$coupon[$couponModel::$name_d]}" class="form-control" id="{$couponModel::$name_d}"
											name="{$couponModel::$name_d}"> <span id="err_attr_name"
											style="color: #F00; display: none;"></span></td>
										<td class="col-sm-4">请填写优惠券名称</td>
									</tr>
									<tr>
										<td>优惠券面额：</td>
										<td><input type="text" value="{$coupon[$couponModel::$money_d]}"
											class="form-control" id="{$couponModel::$money_d}" name="{$couponModel::$money_d}"></td>
										<td class="col-sm-4">优惠券可抵扣金额</td>
									</tr>
									<tr>
										<td>消费金额：</td>
										<td><input type="text" value="{$coupon[$couponModel::$condition_d]}"
											class="form-control active" id="{$couponModel::$condition_d}" name="{$couponModel::$condition_d}">
										</td>
										<td class="col-sm-4">可使用最低消费金额</td>
									</tr>
									<tr>
										<td>发放类型:</td>
										<td id="order-status">
											<input  disabled="disabled" <if condition="$coupon[$couponModel::$type_d] == 0"> checked="checked" </if> name="{$couponModel::$type_d}" type="radio" value="0">面额模板 
											<input  disabled="disabled"<if condition="$coupon[$couponModel::$type_d] == 1"> checked="checked" </if> name="{$couponModel::$type_d}" type="radio" value="1">按用户发放 
											<input  disabled="disabled"<if condition="$coupon[$couponModel::$type_d] == 2"> checked="checked" </if> name="{$couponModel::$type_d}" type="radio" value="2">注册发放 
											<input  disabled="disabled"<if condition="$coupon[$couponModel::$type_d] == 3"> checked="checked" </if> name="{$couponModel::$type_d}" type="radio" value="3">邀请发放 
											<input  disabled="disabled"<if condition="$coupon[$couponModel::$type_d] == 4"> checked="checked" </if> name="{$couponModel::$type_d}" type="radio" value="4">线下发放</td>
									</tr>
									
									<tr>
										<td>发放数量:</td>
										<td><input type="text" class="form-control" value="{$coupon[$couponModel::$createnum_d]}"
											id="createnum" name="{$couponModel::$createnum_d}" placeholder="0"
											onpaste="this.value=this.value.replace(/[^\d]/g,'')"
											onkeyup="this.value=this.value.replace(/[^\d]/g,'')" /></td>
										<td class="col-sm-4">发放数量限制(默认为0则无限制)</td>
									</tr>
									
									<tr class="timed">
										<td>发放开始日期:</td>
										<td>
											<div class="input-prepend input-group">
												<span class="add-on input-group-addon"> <i
													class="glyphicon glyphicon-calendar fa fa-calendar"> </i>
												</span> <input type="text"
													value="{$coupon[$couponModel::$sendStart_time_d]|date='Y-m-d',###}"
													class="form-control" id="{$couponModel::$sendStart_time_d}"
													name="{$couponModel::$sendStart_time_d}">
											</div>
										</td>
										<td class="col-sm-4"></td>
									</tr>
									
									<tr class="timed">
										<td>发放结束日期:</td>
										<td>
											<div class="input-prepend input-group">
												<span class="add-on input-group-addon"> <i
													class="glyphicon glyphicon-calendar fa fa-calendar"> </i>
												</span> <input type="text"
													value="{$coupon[$couponModel::$sendEnd_time_d]|date='Y-m-d',###}"
													class="form-control" id="{$couponModel::$sendEnd_time_d}"
													name="{$couponModel::$sendEnd_time_d}">
											</div>
										</td>
										<td class="col-sm-4"></td>
									</tr>
									
									<tr>
			                        <td>使用起始日期:</td>
			                        <td>
			                            <div class="input-prepend input-group">
			                                <span class="add-on input-group-addon">
			                                    <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
			                                </span>
			                                <input type="text" value="{$coupon[$couponModel::$useStart_time_d]|date='Y-m-d H:i:s',###}" class="form-control" id="{$couponModel::$useStart_time_d}" name="{$couponModel::$useStart_time_d}">
			                            </div>
			                        </td>
			                        <td class="col-sm-4"></td>
			                    </tr> 
									
									<tr>
										<td>有效截止日期:</td>
										<td>
											<div class="input-prepend input-group">
												<span class="add-on input-group-addon"> <i
													class="glyphicon glyphicon-calendar fa fa-calendar"></i>
												</span> <input type="text"
													value="{$coupon[$couponModel::$useEnd_time_d]|date='Y-m-d',###}"
													class="form-control" id="{$couponModel::$useEnd_time_d}" name="{$couponModel::$useEnd_time_d}">
											</div>
										</td>
										<td class="col-sm-4"></td>
									</tr>
								</tbody>
								 <tfoot>
                                	<tr>
                                	<td>
                                		<input type="hidden" name="{$couponModel::$id_d}" value="{$coupon[$couponModel::$id_d]}">
                                	</td>
                                	<td class="col-sm-4"></td>
                                	<td class="text-right"><input class="btn btn-primary" type="button" onclick="Conpon.addConpon('{:U('saveEdit')}', 'form')" value="保存"></td>
                                	</tr>
                                </tfoot>          
							</table>
						</div>
					</div>
				</form>
				<!--表单数据-->
			</div>
		</div>
	</div>
</section>
<script src="__COMMON__/js/jquery-form.js"></script>
<script src="__COMMON__/js/alert.js"></script> 
<script src="__JS__/conpon/conpon.js?a={:time()}"></script>
</block>